package com.clotingshoppos.modules.Shiro.controller;

import com.clotingshoppos.common.util.RetResponse;
import com.clotingshoppos.common.util.RetResult;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: UserController
 * @Description: 普通登陆用户
 * @Author: Izzat
 * @Date: 2019-04-14 21:48
 * @Version: v1.0
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @GetMapping("/getMessage")
    @RequiresRoles(logical = Logical.OR, value = {"user", "admin"})
    public RetResult getMessage() {
        return RetResponse.makeOKRsp().setMsg("成功获得信息");
    }
}